Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

207
Views
Form.Control as="select" seems to be removed in favor of Form.Select, however, Form.Select gives me an error

I am migrating from React-Bootstrap v1 to v2 and from Bootstrap v4 to v5 but I'm facing the issue of Form.Select giving me an error saying "Property 'Select' does not exist on type 'Form'". I'm trying to use Form.Select because the migration documentation says that:

FormControl#
    dropped as prop supporting select tags in favor of FormSelect.

My original component looked like this:

import Form, { FormProps } from 'react-bootstrap/Form';

return (
    <Form.Control
        as="select"
        value={selected || ''}
        onChange={(ev: ChangeEvent<HTMLSelectElement>) => onSelect(ev.target.value)}
        {...rest}
        style={{ width: 'fit-content', paddingRight: 20, ...rest.style }} // Styled Components break the Form.Control's base styles
    >
        <option hidden key="default-empty-option" />

        {options.map(({ value, label }, idx) => (
            <>
                {value === customOptionValue ? (
                    <>
                        <option data-testid={`dropdown-option-${idx}`} key={idx} value={value}>
                            {label}
                        </option>

                        <OptionSeperator key="separator" />
                    </>
                ) : (
                    <option data-testid={`dropdown-option-${idx}`} key={idx} value={value}>
                        {label}
                    </option>
                )}
            </>
        ))}
    </Form.Control>

And my new one looks like this:

return (
    <Form.Select
        value={selected || ''}
        onChange={(ev: ChangeEvent<HTMLSelectElement>) => onSelect(ev.target.value)}
        style={{ width: 'fit-content', paddingRight: 20, ...rest.style }} // Styled Components break the Form.Control's base styles
    >
        <option hidden key="default-empty-option" />

        {options.map(({ value, label }, idx) => (
            <>
                {value === customOptionValue ? (
                    <>
                        <option data-testid={`dropdown-option-${idx}`} key={idx} value={value}>
                            {label}
                        </option>

                        <OptionSeperator key="separator" />
                    </>
                ) : (
                    <option data-testid={`dropdown-option-${idx}`} key={idx} value={value}>
                        {label}
                    </option>
                )}
            </>
        ))}
    </Form.Select>
);
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!